Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: Files

Previous | Chapter Top | Chapter Contents | Next |

Obtaining Volume Information

You can get information about a volume by calling the GetVInfo or GetVRefNum function.

GetVInfo

You can use the GetVInfo function to get information about a mounted volume.

FUNCTION GetVInfo (drvNum: Integer; volName: StringPtr;
                                         VAR vRefNum: Integer;
                                         VAR freeBytes: LongInt): OSErr;
drvNum
The drive number of the volume for which information is requested.
volName
On output, a pointer to the name of the specified volume.
vRefNum
The volume reference number of the specified volume.
freeBytes
The available space (in bytes) on the specified volume.

DESCRIPTION

The GetVInfo function returns the name, volume reference number, and available space (in bytes) for the specified volume. You specify a volume by providing its drive number in the drvNum parameter. You can pass 0 in the drvNum parameter to get information about the default volume.

RESULT CODES

noErr

0

No error

nsvErr

-35

No such volume

paramErr

-50

No default volume

GetVRefNum

You can use the GetVRefNum function to get a volume reference number from a file reference number.

FUNCTION GetVRefNum (refNum: Integer; VAR vRefNum: Integer):
                                         OSErr;
refNum
The file reference number of an open file.
vRefNum
On exit, the volume reference number of the volume containing the file specified by refNum .

DESCRIPTION

The GetVRefNum function returns the volume reference number of the volume containing the specified file. If you also want to determine the directory ID of the specified file's parent directory, call the PBGetFCBInfo function.

RESULT CODES

noErr

0

No error

rfNumErr

-51

Bad reference number


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next